package com.ruoyi.service.masterdate.impl;

import com.ruoyi.common.annotation.DataSource;
import com.ruoyi.common.enums.DataSourceType;
import com.ruoyi.mapper.jpjs.person.PersonMapper;
import com.ruoyi.mapper.masterdate.DepartmentMapper;
import com.ruoyi.service.jpjs.person.PersonService;
import com.ruoyi.service.masterdate.DepartmentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

@Service
@DataSource(value = DataSourceType.SLAVE)
public class DepartmentServiceImpl implements DepartmentService {
    @Autowired
    private DepartmentMapper departmentMapper;

    @Override
    public List<Map<String, Object>> findDepartmentAll(Map<String, Object> map) {
        return departmentMapper.findDepartmentAll(map);
    }

    @Override
    public Map<String, Object> findDepartment(String id) {
        return departmentMapper.findDepartment(id);
    }

    @Override
    public int addDepartment(Map<String, Object> map) {
        return departmentMapper.addDepartment(map);
    }

    @Override
    public int editDepartment(Map<String, Object> map) {
        return departmentMapper.editDepartment(map);
    }

    @Override
    public int checkCodeUnique(Map<String, Object> map) {
        return departmentMapper.checkCodeUnique(map);
    }
}
